<template>
  <div>
    <el-card>
      <span slot="header">
        <i class="el-icon-paperclip"></i>
        <span style="font-weight: 700; margin-right: 10px"> 2020-1-1 </span>
        <span> 订单号:3407138749884 </span>
      </span>
      <table>
        <tr>
          <td>
            <span
              ><img :src="src" alt="" style="width: 80px; height: 80px"
            /></span>
          </td>
          <td valign="top" style="width: 330px">
            <span>商品名称呱呱呱呱呱呱呱呱呱呱呱呱呱呱呱古古怪怪</span>
          </td>
          <td valign="top" style="width: 100px; text-align: center">
            <span>￥70</span>
          </td>
          <td valign="top" style="width: 100px; text-align: center">
            <span>1</span>
          </td>
          <td valign="top" style="width: 100px; text-align: center">
            <a href="">订单详情</a>
          </td>
          <td valign="top" style="width: 100px; text-align: center">
            <span>交易成功</span>
          </td>
        </tr>
      </table>
      <div>
        <div style="text-align: right; margin-right: 20px; margin-top: 10px">
          共<span class="red">2</span>件商品
          <span style="font-size: 18px">
            <b>
              实付:
              <span style="color: #ff2832">¥</span>
              <span class="red">20</span>
            </b>
          </span>
        </div>
      </div>
    </el-card>
  </div>
</template>

<script>
import { getAllOrder } from "../api/order";
export default {
  data() {
    return {
      src: "https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg",
    };
  },
  props: {
    goodId: {
      type: Number,
      require: true,
    },
  },
  mounted() {
    var userid = localStorage.getItem("userId");
    if (this.goodId == 1) {
      getAllOrder(userid).then(({ data }) => {
        console.log(data);
      });
    }else{
        console.log(1);
    }
  },
};
</script>

<style scoped>
table {
  font-size: 14px;
  border-collapse: collapse;
}

tr {
  border-bottom: 1px solid rgb(228, 224, 224);
  padding-top: 10px;
  display: block;
}
</style>